from PyMimircache import Cachecow

c=Cachecow()

# write_path="logfile_2.txt"
# write_file=open(write_path,mode='a+')
# hit_dict={}
# for i in range(27):
#     path="traces/YCSB-unfold0/YCSB-sample110000/YCSB-"+str(i)+".txt"
#     reader=c.open(path)
#     ssd_size=reader.get_num_of_uniq_req()   
#     profiler_LRU=c.profiler('LRU')
#     hit_ratio=profiler_LRU.get_hit_ratio()
#     cache_size=int(0.25*ssd_size)

#     hit_dict["YCSB-sample110000/YCSB-"+str(i)+".txt"]=hit_ratio[cache_size]

# write_file.write(str(hit_dict))



path="traces/MSR/prxy1_inverse_sample100000.txt"
reader=c.open(path)
ssd_size=reader.get_num_of_uniq_req()   
profiler_LRU=c.profiler('LRU')
hit_ratio=profiler_LRU.get_hit_ratio()
cache_size=int(0.25*ssd_size)
print(hit_ratio[cache_size])